﻿<Window x:Class="BDDEditor.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:avalonEdit="http://icsharpcode.net/sharpdevelop/avalonedit"
        Title="BDD Editor" Height="350" Width="525" WindowState="Maximized" Closing="Window_Closing">
    <Window.InputBindings>
        <KeyBinding Command="{Binding SaveFileCommand}" 
              Gesture="CTRL+S" />
        <KeyBinding Command="Find"
              Gesture="CTRL+F" />
    </Window.InputBindings>
    <Grid>
        <DockPanel>
            <ToolBar DockPanel.Dock="Top">
                <ToolBar.Resources>
                    <Style TargetType="{x:Type Image}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type ButtonBase}, AncestorLevel=1}, Path=IsEnabled}" Value="False">
                                <Setter Property="Opacity" Value="0.30" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ToolBar.Resources>
                <Button Click="newFileClick">
                    <Image Source="Images/new.png" Height="16"/>
                </Button>
                <Button Click="openFileClick">
                    <Image Source="Images/Open.png" Height="16"/>
                </Button>
                <Button Click="saveFileClick">
                    <Image Source="Images/Save.png" Height="16"/>
                </Button>
                <Separator/>
                <Button Command="Cut">
                    <Image Source="Images/Cut.png" Height="16"/>
                </Button>
                <Button Command="Copy">
                    <Image Source="Images/Copy.png" Height="16"/>
                </Button>
                <Button Command="Paste">
                    <Image Source="Images/Paste.png" Height="16"/>
                </Button>
                <Button Command="Delete">
                    <Image Source="Images/Delete.png" Height="16"/>
                </Button>
                <Separator/>
                <Button Command="Undo">
                    <Image Source="Images/Undo.png" Height="16"/>
                </Button>
                <Button Command="Redo">
                    <Image Source="Images/Redo.png" Height="16"/>
                </Button>
                <Separator/>
                <CheckBox IsChecked="{Binding ElementName=textEditor,Path=WordWrap}">
                    <Image Source="Images/WordWrap.png" Height="16"/>
                </CheckBox>
                <CheckBox IsChecked="{Binding ElementName=textEditor,Path=ShowLineNumbers}">
                    <TextBlock Width="16" TextAlignment="Center">#</TextBlock>
                </CheckBox>
                <CheckBox IsChecked="{Binding ElementName=textEditor,Path=Options.ShowEndOfLine}">
                    <TextBlock Width="16" TextAlignment="Center">¶</TextBlock>
                </CheckBox>
                <ComboBox Name="highlightingComboBox"
                SelectedItem="{Binding SyntaxHighlighting, ElementName=textEditor}"
                ItemsSource="{Binding Source={x:Static avalonEdit:HighlightingManager.Instance}, Path=HighlightingDefinitions}"
                SelectionChanged="HighlightingComboBox_SelectionChanged"/>
                <TextBox Name="FeatureFolder" Width="200"></TextBox>
                <Button Click="Button_Click" Width="120">Browse BDDFolder</Button>
            </ToolBar>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>                    
                </Grid.ColumnDefinitions>
                <avalonEdit:TextEditor
                Name="textEditor"
                FontFamily="Consolas"
                FontSize="10pt"
                SyntaxHighlighting="C#"
            ></avalonEdit:TextEditor>
            </Grid>
        </DockPanel>
    </Grid>
</Window>
